<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form method="post" action="?" id="dform">
    <input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
    <input type="hidden" name="file" value="<?php echo $file;?>"/>
    <input type="hidden" name="action" value="<?php echo $action;?>"/>
    <input type="hidden" name="itemid" value="<?php echo $itemid;?>"/>
	<input type="hidden" name="forward" value="<?php echo $forward;?>"/>
    <div class="tt"><?php echo $action == 'add' ? '添加' : '修改';?>公告</div>
    <table cellpadding="2" cellspacing="1" class="tb">
        <tr>
            <td class="tl"><span class="f_red">*</span> 公告分类</td>
            <td><?php echo type_select('announce', 1, 'post[typeid]', '请选择分类', $typeid, 'id="typeid"');?> <a href="?file=type&item=<?php echo $file;?>" class="t">[管理分类]</a> <span id="dtypeid" class="f_red"></span></td>
        </tr>
        <tr>
            <td class="tl"><span class="f_red">*</span> 公告标题</td>
            <td><input name="post[title]" type="text" id="title" size="50" datatype="*2-999" nullmsg="请填写标题" errormsg="最少输入2个字符" value="<?php echo $title;?>"/> <?php echo dstyle('post[style]', $style);?>&nbsp; <?php echo level_select('post[level]', '级别',
		            $level);?> &nbsp;<input type="checkbox" name="post[islink]" value="1" id="islink"
                                                                                                                                                                                                                                 onclick="_islink();"  <?php if ($islink) echo 'checked';?>/> 外部链接
                <br/><span id="dtitle" class="f_red"></span></td>
        </tr>

        <tr id="link" style="display:<?php echo $islink ? '' : 'none';?>;">
            <td class="tl"><span class="f_red">*</span> 链接地址</td>
            <td><input name="post[linkurl]" type="text" id="linkurl" size="50" value="<?php echo $linkurl;?>"/> <span id="dlinkurl" class="f_red"></span></td>
        </tr>
        <tbody id="basic" style="display:<?php echo $islink ? 'none' : '';?>;">
        <tr>
            <td class="tl"><span class="f_red">*</span> 公告内容</td>
	        <td><?php echo Post::kindEditor('post[content]', $moduleid, $content, 'datatype="*5-99999" nullmsg="请填写内容" errormsg="内容最少5字"','800px'); ?></td>
        </tr>
        <tr>
            <td class="tl" height="30"><span class="f_hid">*</span> 内容选项</td>
            <td><input type="checkbox" name="post[save_remotepic]" value="1"/> 下载内容远程图片
                <input type="checkbox" name="post[clear_link]" value="1"/> 清除内容链接
            </td>
        </tr>
		<?php if ($DT['city']) { ?>
        <tr>
            <td class="tl"><span class="f_hid">*</span> 地区(分站)</td>
            <td><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?></td>
        </tr>
			<?php } ?>
        <tr title="请保持时间格式">
            <td class="tl"><span class="f_hid">*</span> 添加时间</td>
	        <td><?php echo Post::datetimeBox('post[addtime]', $addtime, 'width:140'); ?></td>
        </tr>
        <tr>
            <td class="tl"><span class="f_hid">*</span> 内容模板</td>
            <td><?php echo tpl_select('announce', $module, 'post[template]', '默认模板', $template);?></td>
        </tr>
        </tbody>
    </table>
    <div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="btn"/></div>
</form>
<script type="text/javascript">
	seajs.use(['$', 'vf', 'vf-css', 'easyui','easyui-css'], function($){
		$('#dform').Validform({
			beforeCheck:function(curform){
				lemon.editor.post_content_.sync();
			}
		});
	})
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>
